<?php
namespace ZN\ViewObjects\Javascript;

class __USE_STATIC_ACCESS__JS
{
	//----------------------------------------------------------------------------------------------------
	//
	// Yazar      : Ozan UYKUN <ozanbote@windowslive.com> | <ozanbote@gmail.com>
	// Site       : www.zntr.net
	// Lisans     : The MIT License
	// Telif Hakkı: Copyright (c) 2012-2016, zntr.net
	//
	//----------------------------------------------------------------------------------------------------
	
	//----------------------------------------------------------------------------------------------------
	// Call Method
	//----------------------------------------------------------------------------------------------------
	// 
	// __call()
	//
	//----------------------------------------------------------------------------------------------------
	use \CallUndefinedMethodTrait;
	
	//----------------------------------------------------------------------------------------------------
	// Protected Js Func
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $func
	// @param  string $code
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	protected function _jsFunc($func = '', $code = '', $comma = false)
	{
		return "$func($code)".($comma === true ? ";" : "");
	}
	
	//----------------------------------------------------------------------------------------------------
	// Interval 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $time
	// @param  string $code
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function interval($time = '', $code = '', $comma = true)
	{
		return $this->_jsFunc('setInterval', "$code, $time", $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Timeout 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $time
	// @param  string $code
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function timeout($time = '', $code = '', $comma = true)
	{
		return $this->_jsFunc('setTimeout', "$code, $time", $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// indexOf 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function indexOf($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("String($str).indexOf", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// indexOf 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayIndexOf($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).indexOf", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Join 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayJoin($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).join", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// lastIndexOf 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function lastIndexOf($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("String($str).lastIndexOf", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// lastIndexOf 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayLastIndexOf($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).lastIndexOf", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// splice 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arraySplice($str = '', $p1 = '', $p2 = '', $p3 = '', $p4 = '', $comma = true)
	{
		$param[] = $p1;
		$param[] = $p2;
		$param[] = $p3;
		$param[] = $p4;
		return $this->_jsFunc("Array($str).splice", implode(",", array_diff($param, [''])), $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// length 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function length($str = '', $comma = true)
	{
		return "String($str).length".($comma === true ? ';' : '');
	}
	
	//----------------------------------------------------------------------------------------------------
	// length 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayLength($str = '', $comma = true)
	{
		return "Array($str).length".($comma === true ? ';' : '');
	}
	
	//----------------------------------------------------------------------------------------------------
	// arrayUnshift 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayUnshift($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).unshift", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// arrayUnshift 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arraySort($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).sort", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// pop 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayPop($str = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).pop", $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Reverse 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayReverse($str = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).reverse", $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// toString 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayToString($str = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).toString", $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Shift 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayShift($str = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).shift", $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// push 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayPush($str = '', $param = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).push", $param, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// search 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $find
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function search($str = '', $find = '', $comma = true)
	{
		return $this->_jsFunc("String($str).search", $find, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// slice 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function slice($str  = '', $p1 = '', $p2 ='', $comma = true)
	{
		return $this->_jsFunc("String($str).slice", "$p1, $p2" , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// slice 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arraySlice($str  = '', $p1 = '', $p2 ='', $comma = true)
	{
		return $this->_jsFunc("Array($str).slice", "$p1, $p2" , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// substr 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function substr($str  = '', $p1 = '', $p2 = '', $comma = true)
	{
		return $this->_jsFunc("String($str).substr", "$p1, $p2" , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// substring 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function substring($str  = '', $p1 = '', $p2 = '', $comma = true)
	{
		return $this->_jsFunc("String($str).substring", "$p1, $p2" , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// replace 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function replace($str  = '', $p1  = '', $p2 = '', $comma = true)
	{
		return $this->_jsFunc("String($str).replace", "$p1, $p2" , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Upper Case 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function upperCase($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).toUpperCase", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Lowe Case 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function lowerCase($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).toLowerCase", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// concat 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function concat($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).concat", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// concat 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function arrayConcat($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("Array($str).concat", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// charAt 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function charAt($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).charAt", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// charCodeAt 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function codeAt($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).charCodeAt", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// split 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function split($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).split", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// localeCompare 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function localeCompare($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).localeCompare", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// match 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function match($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).match", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// trim 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function trim($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).trim", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// anchor 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function anchor($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).anchor", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// fontcolor 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function fontColor($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).fontcolor", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// fontsize 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function fontSize($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).fontsize", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// link 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function link($str  = '', $param  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).link", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// big 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function big($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).big", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// small 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function small($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).small", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// strike 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function strike($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).strike", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// sub 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function sub($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).sub", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// sup 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function sup($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).sup", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// toString 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function toString($str  = '', $comma = true)
	{
		return $this->_jsFunc("Number($str).toString", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// valueOf 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function valueOf($str  = '', $comma = true)
	{
		return $this->_jsFunc("Number($str).valueOf", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// toExponential 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function toExponential($str  = '', $param = '', $comma = true)
	{
		return $this->_jsFunc("Number($str).toExponential", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// toFixed 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function toFixed($str  = '', $param = '', $comma = true)
	{
		return $this->_jsFunc("Number($str).toFixed", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// toPrecision 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function toPrecision($str  = '', $param = '', $comma = true)
	{
		return $this->_jsFunc("Number($str).toPrecision", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// sqrt 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function sqrt($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.sqrt", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// abs 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function abs($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.abs", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// acos 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function acos($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.acos", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// asin 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function asin($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.asin", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// atan 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function atan($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.atan", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// atan2 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function atan2($p1 = '', $p2 = '', $comma = true)
	{
		$param[] = $p1;
		$param[] = $p2;
		return $this->_jsFunc("Math.atan2", "$p1, $p2" , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// ceil 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function ceil($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.ceil", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// cos 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function cos($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.cos", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// exp 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function exp($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.exp", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// floor 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function floor($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.floor", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// log 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function log($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.log", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// max 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function max($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.max", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// round 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function round($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.round", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// sin 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function sin($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.sin", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// tan 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function tan($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.tan", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// random 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function random($comma = true)
	{
		return $this->_jsFunc("Math.random", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// min 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function min($param = '', $comma = true)
	{
		return $this->_jsFunc("Math.min", $param , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// pow 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function pow($p1 = '', $p2 = '', $comma = true)
	{
		$param[] = $p1;
		$param[] = $p2;
		return $this->_jsFunc("Math.pow", "$p1, $p2" , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// pi 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function pi($comma = true)
	{
		return $this->_jsFunc("Math.pi", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// blink 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function blink($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).blink", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// bold 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function bold($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).bold", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// fixed 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function fixed($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).fixed", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// italic 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function italic($str  = '', $comma = true)
	{
		return $this->_jsFunc("String($str).italics", '' , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// fromCharCode 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $str
	// @param  string $param
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function ascii($str  = '', $comma = true)
	{
		return $this->_jsFunc("String.fromCharCode", $str , $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// define 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $varname
	// @param  string $value
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function define($varname  = '', $value = '', $operator = '=')
	{
		return EOL.'var '.$varname.' '.$operator.' '.suffix(trim($value, EOL), ';');
	}
	
	//----------------------------------------------------------------------------------------------------
	// Function 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $varname
	// @param  string $value
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function defineFunc($funcname  = '', $param = '', $code = '')
	{
		return EOL.'function '.$funcname.' ('.$param.') {'.$code.'}'.EOL;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Function 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $varname
	// @param  string $value
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function func($funcname  = '', $param = '')
	{
		return $funcname.'('.$param.');';
	}
	
	//----------------------------------------------------------------------------------------------------
	// Alert 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $code
	// @param  bool   $comma
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function alert($code = '', $comma = true)
	{
		return $this->_jsFunc('alert', $code, $comma);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Confirm 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $code
	// @param  string $true
	// @param  string $false
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function confirm($code = '', $true = '', $false = '')
	{
		 $confirm = $this->_jsFunc('confirm', \JQ::stringControl($code), false);
		 
		 if( empty($true) )
		 {
			 return "$confirm;";
		 }
		 
		 return $this->ifClause("$confirm === true", $true).$this->elseClause($false);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Protected Clause 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $type
	// @param  string $condition
	// @param  string $code
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	protected function _clause($type = '', $condition = '', $code = '')
	{
		$eol = EOL;
		return $this->_jsFunc($type, $condition, false)."{".$code."}";
	}
	
	//----------------------------------------------------------------------------------------------------
	// If Clause 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $condition
	// @param  string $code
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function ifClause($condition = '', $code = '' , $elseCode = '')
	{
		$elseCode = ! empty($elseCode) ? $this->elseClause($elseCode) : '';
		
		return $this->_clause('if', $condition, $code).$elseCode;
	}
	
	//----------------------------------------------------------------------------------------------------
	// Else If Clause 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $condition
	// @param  string $code
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function elseIfClause($condition = '', $code = '')
	{
		return $this->_clause('else if', $condition, $code);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Else Clause 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $code
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function elseClause($code = '')
	{
		return "else{".$code."}";
	}
	
	//----------------------------------------------------------------------------------------------------
	// For Loop 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $condition
	// @param  string $code
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function forLoop($condition = '', $code = '')
	{
		return $this->_clause('for', $condition, $code);
	}
	
	//----------------------------------------------------------------------------------------------------
	// While Loop 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $condition
	// @param  string $code
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function whileLoop($condition = '', $code = '')
	{
		return $this->_clause('while', $condition, $code);
	}
	
	//----------------------------------------------------------------------------------------------------
	// Do While Loop
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $condition
	// @param  string $code
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function doWhileLoop($condition, $code = '')
	{
		return "do{".$code."}while(".$condition.")";
	}
	
	//----------------------------------------------------------------------------------------------------
	// Switch Clause 
	//----------------------------------------------------------------------------------------------------
	//
	// @param  string $condition
	// @param  array  $cases
	// @return string
	//
	//----------------------------------------------------------------------------------------------------
	public function switchClause($condition = '', $cases = [])
	{
		$clause = '';
		
		if( ! empty($cases) ) foreach( $cases as $case => $code )
		{
			if( $case !== 'multiple' )
			{
				if( $case !== 'default' )
				{
					$clause .= "case $case : $code break; ";
				}
				else
				{
					$clause .= "$case : $code";
				}
			}
			else
			{
				$multiple = isset($code[0]) ?  $code[0] : [];
				$mcode    = isset($code[1]) ?  $code[1] : '';
				
				if( ! empty($multiple) ) foreach( $multiple as $val )
				{
					$clause .= "case $val : ";	
				}
				
				$clause .= "$mcode break; ";
			}
		}
		
		return "switch($condition){".$clause."}";
	}
}